package com.itheima;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class MyTest {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        String[] empty = {};
        String[] strArr = list.toArray(empty);
        System.out.println(Arrays.toString(strArr));
        System.out.println("=============================");
        List<String> list2 = new ArrayList<>();
        list2.add("aaa");
        list2.add("bbb");
        list2.add("ccc");
        String[] strArr2 = list2.toArray(empty);
        System.out.println(Arrays.toString(strArr2));
    }
}
